package com.yourname.myapplication.data.room.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.yourname.myapplication.data.model.Question
import kotlinx.coroutines.flow.Flow

@Dao
interface QuestionDao {
    @Insert
    suspend fun insert(question: Question)

    @Query("SELECT * FROM questions")
    fun getAllQuestions(): Flow<List<Question>>

    @Query("SELECT * FROM questions WHERE chapter = :chapter")
    fun getQuestionsByChapter(chapter: Int): Flow<List<Question>>

    // 更多根据需求的查询方法，比如获取错题、收藏题等
}